package com.matt.foundation.DO;

import com.matt.commons.exception.BusinessException;
import com.matt.foundation.model.ErrorCode;
import lombok.Data;

import java.util.List;


/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/11/28
 * *******************************
 */
@Data
public class ClassChildrenListDO {
    private String id;
    private String name;
    private Integer category;
    private String inChargeTeacherName;
    private String inChargeTeacherId;

    public static ClassChildrenListDO of(ClassListDO classListDO){
        if (classListDO == null){
            throw new BusinessException(ErrorCode.PARAM_CAN_NOT_BLANK, "参数错误");
        }

        ClassChildrenListDO ret = new ClassChildrenListDO();

        ret.id = classListDO.getId();
        ret.name = classListDO.getName();
        ret.category = classListDO.getCategory();
        ret.inChargeTeacherId = classListDO.getInChargeTeacherId();
        ret.inChargeTeacherName = classListDO.getInChargeTeacherName();

        return ret;
    }

    List<ClassChildrenDO> childrenList;
}
